const { login } = require('../dao/loginsDao.js')

module.exports.login = async info => {
    const data = await login(info);
    // console.log(data);
    if (data.length > 0 ) {
        if(data[0].status) {
            return {
                message: '登录成功',
                status: 1,
                data
            }
        }
        return {
            message: '账号已禁用',
            status: 1,
            data
        }
        
    }
    return {
        message: '登录失败',
        status: 0,
    }
}